home *** CD-ROM | disk | FTP | other *** search
/ Internet Surfer 2.0 / Internet Surfer 2.0 (Wayzata Technology) (1996).iso / pc / textfile / faqs / emacs_fa / part2 < prev    next >
Encoding:
Text File  |  1992-12-26  |  48.8 KB  |  1,156 lines

  1. Xref: bloom-picayune.mit.edu gnu.emacs.help:7400 comp.emacs:15249 news.answers:3114
  2. Path: bloom-picayune.mit.edu!enterpoop.mit.edu!snorkelwacker.mit.edu!eff!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!uwm.edu!news.bbn.com!bu.edu!bigbird!jbw
  3. From: jbw@bigbird.bu.edu (Joe Wells)
  4. Newsgroups: gnu.emacs.help,comp.emacs,news.answers
  5. Subject: GNU Emacs FAQ (2/5, 28-86): Common Requests/Problems
  6. Summary: READ BEFORE POSTING.  A regularly posted list of answers to frequently
  7.          asked questions (FAQs) about GNU Emacs and many Emacs Lisp programs.
  8.          Contains pointers to other resources.  Follow "References:" link for
  9.          more metainfo.
  10. Keywords: gnu emacs faq answers frequently asked questions periodic
  11. Message-ID: <GNU-Emacs-FAQ-2.1992.09.22.011020@bigbird.bu.edu>
  12. Date: 22 Sep 92 01:10:20 GMT
  13. Expires: 21 Nov 92 01:10:20 GMT
  14. References: <GNU-Emacs-FAQ-0.1992.09.22.011020@bigbird.bu.edu>
  15. Sender: news@bu.edu
  16. Reply-To: gnu-emacs-faq-maintainers@bigbird.bu.edu
  17. Followup-To: poster
  18. Organization: GNU's Not UNIX
  19. Lines: 1133
  20. Approved: news-answers-request@mit.edu
  21. Supersedes: <GNU-Emacs-FAQ-2.1992.06.28.234430@bigbird.bu.edu>
  22.  
  23. Archive-Name: GNU-Emacs-FAQ/part2
  24. Last-Modified: Mon, 21 Sep 1992 03:14:22 GMT
  25. Last-Posted: Tue, 22 Sep 1992 01:10:20 GMT
  26.  
  27.                  GNU Emacs FAQ: Common Requests/Problems
  28.  
  29. If you are viewing this text in a GNU Emacs Buffer, you can type "M-2 C-x $" to
  30. get an overview of just the questions.  Then, when you want to look at the text
  31. of the answers, just type "C-x $".
  32.  
  33. To search for a question numbered XXX, type "M-C-s ^XXX:", followed by a C-r if
  34. that doesn't work, then type ESC to end the search.
  35.  
  36. A `+' in the 78th column means something was inserted on the line.  A `-' means
  37. something was deleted and a `!' means some combination of insertions and
  38. deletions occurred.
  39.  
  40. Full instructions for getting the latest FAQ are in question 22.  Also see the
  41. `Introduction to news.answers' posting in the `news.answers' newsgroup, or send
  42. e-mail to `mail-server@rtfm.mit.edu' with `help' on a body line, or use FTP,
  43. WAIS, or Prospero to rtfm.mit.edu.
  44.  
  45.  
  46.  
  47. Common Things People Want To Do 
  48.  
  49. 28:  How do I set up a .emacs file properly?
  50.   
  51.   See `Init File' in the on-line manual.
  52.   
  53.   WARNING: In general, new Emacs users should not have .emacs files, because
  54.   it causes confusing non-standard behavior.  Then they send questions to
  55.   help-gnu-emacs asking why Emacs isn't behaving as documented.  :-)
  56.   
  57. 29:  How do I debug a .emacs file?
  58.   
  59.   First start Emacs with the `-q' command line option.  Then, in the
  60.   *scratch* buffer, type the following:
  61.   
  62.     (setq debug-on-error t) LFD
  63.     (load-file "~/.emacs") LFD
  64.   
  65.   (Type LFD by pressing C-j.)
  66.   
  67.   If you have an error in your .emacs file, this will invoke the debugger
  68.   when the error occurs.  If you don't know how to use the debugger do
  69.   (setq stack-trace-on-error t) instead.
  70.   
  71.   WARNING: this will not discover errors caused by trying to do something
  72.   that requires the terminal/window-system initialization code to have
  73.   been loaded.  See question 127.
  74.   
  75. 30:  How do I make Emacs display the current line (or column) number?
  76.   
  77.   To find out what line of the buffer you are on right now, do "M-x
  78.   what-line".  Use "M-x goto-line" to go to a specific line.  To find the
  79.   current column number, type "M-ESC (current-column)".
  80.   
  81.   Typing "C-x l" will also tell you what line you are on, provided the
  82.   buffer isn't separated into "pages" with C-l characters.  In that case, it
  83.   will only tell you what line of the current "page" you are on.  WARNING:
  84.   "C-x l" gives the wrong value when point is at the beginning of a line.
  85.   
  86.   There is no "correct" way to constantly display the current (or total)
  87.   line (or column) number on the mode line in Emacs 18, or to display the
  88.   line numbers next to the lines like vi can.  Emacs is not a line-oriented
  89.   editor, and really has no idea what "lines" of the buffer are displayed in
  90.   the window.  It would require a lot of work at the C code level to make
  91.   Emacs keep track of this.  It would not be that hard to get the column
  92.   number, but it would still require changes at the C code level.
  93.   
  94.   None of the vi emulation modes provide the `set number' capability of vi
  95.   (as far as I know).
  96.   
  97.   Emacs 19 will probably be able to show the line number on the mode-line,
  98.   but probably very inefficiently.
  99.   
  100.   People have written various kludges to display line numbers.  One is
  101.   `display-line-numbers' by Wayne Mesard <wmesard@tofu.oracle.com,
  102.   Mesard@bbn.com>.  Look in the Lisp Code Directory.  (See question
  103.   88.)
  104.   
  105. 31:  How do I turn on Abbrevs by default just in mode XXX?
  106.   
  107.   Put this in your .emacs file:
  108.   
  109.     (condition-case ()
  110.     (read-abbrev-file nil t)
  111.       (file-error nil))
  112.   
  113.     (setq XXX-mode-hook
  114.       (function
  115.        (lambda ()
  116.          (setq abbrev-mode t))))
  117.   
  118. 32:  How do I turn on Auto-Fill mode by default?
  119.   
  120.   To turn on Auto-Fill mode just once for one buffer, use "M-x
  121.   auto-fill-mode".  To turn it on for every buffer in, for example, Text
  122.   mode, do this:
  123.   
  124.     (setq text-mode-hook 'turn-on-auto-fill)
  125.   
  126.   If you want Auto-Fill mode on in all major modes, do this:
  127.   
  128.     (setq-default auto-fill-hook 'do-auto-fill)
  129.   
  130. 33:  How do I make Emacs use a certain major mode for certain files?
  131.   
  132.   If you want to use XXX mode for all files which end with the extension
  133.   `.YYY', this will do it for you:
  134.   
  135.     (setq auto-mode-alist (cons '("\\.YYY\\'" . XXX-mode) auto-mode-alist))
  136.   
  137.   Otherwise put this somewhere in the first line of any file you want to
  138.   edit in XXX mode:
  139.   
  140.     -*-XXX-*-
  141.   
  142. 34:  How do I search for, delete, or replace unprintable (8-bit or control)
  143.  characters?
  144.   
  145.   To search for a single character that appears in the buffer as, for
  146.   example, `\237', you can type "C-s C-q 2 3 7".  (This assumes the value of
  147.   search-quote-char is 17 (ie., C-q).)  Searching for ALL unprintable
  148.   characters is best done with a "regexp" search.  The easiest regexp to use
  149.   for the unprintable chars is the complement of the regexp for the
  150.   printable chars.
  151.   
  152.   Regexp for the printable chars: [\t\n\r\f -~]
  153.   
  154.   Regexp for the unprintable chars: [^\t\n\r\f -~]
  155.   
  156.   To type some of these special characters in an interactive argument to
  157.   isearch-forward-regexp or re-search-forward, you need to use C-q.  (`\t',
  158.   `\n', `\r', and `\f' stand respectively for TAB, LFD, RET, and C-l.)  So,
  159.   to search for unprintable characters using re-search-forward:
  160.   
  161.     M-x re-search-forward RET [^ TAB C-q LFD C-q RET C-q C-l SPC -~] RET
  162.   
  163.   Using isearch-forward-regexp:
  164.   
  165.     M-C-s [^ TAB RET C-q RET C-q C-l SPC -~]
  166.   
  167.   To delete all unprintable characters, simply use a replace-regexp:
  168.   
  169.     M-x replace-regexp RET [^ TAB C-q LFD C-q RET C-q C-l SPC -~] RET RET
  170.   
  171.   Replacing is similar to the above.  {I need to write the text for this
  172.   part of the answer!}
  173.   
  174.   Notes:
  175.   
  176.   * With isearch, you can type RET to get a quoted LFD (not a quoted RET).
  177.   
  178.   * You don't need to quote TAB with either isearch or typing something in
  179.     the minibuffer.
  180.   
  181.   Here are the Emacs Lisp forms of the above regexps:
  182.   
  183.     ;; regexp matching all printable characters:
  184.     "[\t\n\r\f -~]"
  185.   
  186.     ;; regexp matching all unprintable characters:
  187.     "[^\t\n\r\f -~]"
  188.   
  189. 35:  How can I highlight a region of text in Emacs?
  190.   
  191.   There are ways to get highlighting (reverse video, inverse video) in GNU
  192.   Emacs 18.58, but either they require patching the C code of Emacs and
  193.   rebuilding, or they are slow and the highlighting disappears if you scroll
  194.   or redraw the screen and it can not follow the point.  Howard Gayle's
  195.   patches for 8-bit output appear to allow highlighting (see question
  196.   ^8-bit-output).  Another patch for highlighting is by Kenichi Handa
  197.   <handa@etl.go.jp>.  There is a patch for use with X by Andy Norman
  198.   <ange@hplb.hpl.hp.com> (and modified for 18.57 by Matthieu Herrb
  199.   <matthieu@laas.fr>), which is available for FTP:                           !
  200.                                                                              !
  201.     /laas.laas.fr:pub/emacs/patch-X11-18.5{5,7}                              !
  202.   
  203.   You can highlight regions in a variety of ways in Epoch and Lucid Emacs.
  204.   GNU Emacs 19 may not be able to just temporarily highlight a region.       !
  205.   
  206.   Similar comments apply to displaying text in different fonts, except that
  207.   it is even harder.
  208.   
  209. 36:  How do I control Emacs's case-sensitivity when searching/replacing?
  210.     
  211.   For searching, the value of the variable case-fold-search determines
  212.   whether they are case sensitive:
  213.   
  214.     (setq case-fold-search nil) ; make searches case sensitive
  215.     (setq case-fold-search t)   ; make searches case insensitive
  216.   
  217.   Similarly, for replacing the variable case-replace determines whether
  218.   replacements preserve case.
  219.   
  220.   To change the case sensitivity just for one major mode, use the major
  221.   mode's hook.  For example:
  222.   
  223.     (setq XXX-mode-hook
  224.           (function
  225.        (lambda ()
  226.          (setq case-fold-search nil))))
  227.   
  228. 37:  How do I make Emacs wrap words for me?
  229.   
  230.   M-x auto-fill-mode.  The default maximum line width is 74, determined by
  231.   the variable fill-column.  To find how to turn this on automatically see
  232.   question 32.
  233.   
  234. 38:  Where can I get a better spelling checker for Emacs?
  235.   
  236.   Use Ispell.  See question 119.
  237.   
  238. 39:  How can I spell-check TeX or *roff documents?
  239.   
  240.   If you want to spell-check TeX or *roff documents with Ispell, you need to
  241.   arrange for a filter program that understands how to strip TeX or *roff
  242.   formatting commands to be run.  In the TeX distribution, there are several
  243.   different programs named `detex', all with incompatible options, and a
  244.   very old pair of programs named `detex' and `delatex', which should
  245.   probably be avoided.  The most useful one for Ispell is `detex' by Daniel
  246.   Trinkle.  A more recent version is available via FTP:                      !
  247.                                                                              !
  248.     /arthur.cs.purdue.edu:pub/trinkle/detex-2.3.tar.Z                        !
  249.   
  250.   Raphael Cerf <cerf@clipper.ens.fr> recently released a program for this    +
  251.   named `xetal':                                                             !
  252.                                                                              !
  253.     /spi.ens.fr:pub/unix/tex/                                                !
  254.   
  255.   There is a program that comes with Unix named `deroff' for stripping
  256.   formatting commands from *roff files.
  257.   
  258.   Here is an example of code you can put in a .emacs file to use these
  259.   programs:
  260.   
  261.     ;; Based on suggestions by David G. Grubbs <dgg@ksr.com> and Paul Palmer
  262.     ;; <palmerp@math.orst.edu>.
  263.   
  264.     ;; Assuming the use of detex 2.3 by Daniel Trinkle:
  265.     ;; -w means one word per line.
  266.     ;; -n means don't expand \input or \include commands.
  267.     ;; -l means force LaTeX mode.
  268.   
  269.     (require 'ispell) ; for the make-variable-buffer-local statements
  270.     (setq plain-TeX-mode-hook
  271.       (function
  272.        (lambda ()
  273.          (setq ispell-filter-hook "detex")
  274.              (setq ispell-filter-hook-args '("-nw")))))
  275.     (setq LaTeX-mode-hook
  276.       (function
  277.        (lambda ()
  278.          (setq ispell-filter-hook "detex")
  279.              (setq ispell-filter-hook-args '("-lnw")))))
  280.     (setq nroff-mode-hook
  281.       (function
  282.        (lambda ()
  283.          (setq ispell-filter-hook "deroff")
  284.              (setq ispell-filter-hook-args '("-w")))))
  285.   
  286.   You will have to adjust the arguments for programs other than Trinkle's
  287.   detex or for other versions of deroff.  Experiment running the command
  288.   from the shell to find the correct options.  If you don't have a filter
  289.   that knows how to output one word per line, you must pipe its output
  290.   through another filter to break up the output.
  291.   
  292. 40:  How do I change load-path?
  293.   
  294.   In general, you should only *add* to the load-path.  You can add
  295.   directory /XXX/YYY to the load path like this:
  296.   
  297.     (setq load-path (append load-path '("/XXX/YYY/")))
  298.   
  299.   To do this relative to your home directory:
  300.   
  301.     (setq load-path (append load-path (list (expand-file-name "~/YYY/"))))
  302.   
  303. 41:  How do I use an already running Emacs from another window?
  304.   
  305.   The `emacsclient' program is for editing a file using an already running
  306.   Emacs rather than starting up a new Emacs.  It does this by sending a
  307.   request to the already running Emacs, which must be expecting the request.
  308.   
  309.   * Setup
  310.   
  311.     Emacs must have executed the `server-start' function for emacsclient to
  312.     work.  This can be done either by a command line option:
  313.   
  314.       emacs -f server-start
  315.   
  316.     or by invoking server-start from the .emacs file:
  317.   
  318.       (if (some conditions are met) (server-start))
  319.   
  320.     When this is done, Emacs starts a subprocess running a program called
  321.     `server'.  `server' creates a Unix domain socket in the user's home
  322.     directory named `.emacs_server'.
  323.   
  324.     To get your news reader, mail reader, etc., to invoke emacsclient, try
  325.     setting the environment variable EDITOR (or sometimes VISUAL) to the
  326.     value `emacsclient'.  You may have to specify the full pathname of the
  327.     emacsclient program instead.  Examples:
  328.   
  329.       # csh commands:
  330.       setenv EDITOR emacsclient
  331.       setenv EDITOR /usr/local/emacs/etc/emacsclient  # using full pathname
  332.   
  333.       # sh command:
  334.       EDITOR=emacsclient export EDITOR
  335.   
  336.   * Normal use
  337.   
  338.     When emacsclient is run, it connects to the `.emacs_server' socket and
  339.     passes its command line options to `server'.  When `server' receives
  340.     these requests, it sends this information on the the Emacs process,
  341.     which at the next opportunity will visit the files specified.  (Line
  342.     numbers can be specified just like with Emacs.)  The user will have to
  343.     switch to the Emacs window by hand.  When the user is done editing a
  344.     file, the user can type "C-x #" to indicate this.  This will switch to
  345.     another buffer created at the request of emacsclient if there are any.
  346.     When "C-x #" has been invoked on all of the files that the emacsclient
  347.     requested to be edited, Emacs will send notification of this to `server'
  348.     which will pass this on to the emacsclient, which will then exit.
  349.   
  350.   NOTE: `emacsclient' and `server' must be running on machines which share
  351.   the same filesystem for this to work.  The pathnames that emacsclient
  352.   specifies should be correct for the filesystem that the Emacs process
  353.   sees.  The Emacs process should not be suspended at the time emacsclient
  354.   is invoked.  emacsclient should either be invoked from another X window or
  355.   from a shell window inside Emacs itself.
  356.   
  357.   There is an enhanced version of emacsclient/server called `gnuserv' by
  358.   Andy Norman <ange@hplb.hpl.hp.com> which is available in the Emacs Lisp
  359.   Archive.  gnuserv uses Internet domain sockets, so it can work across most
  360.   network connections.  It also supports the execution of arbitrary Emacs
  361.   Lisp forms and also does not require the client program to wait for
  362.   completion.  It is available via anonymous FTP (Emacs Lisp Archive:
  363.   packages/gnuserv.shar).
  364.   
  365. 42:  How do I make Emacs recognize my compiler's funny error messages?
  366.   
  367.   Write a program which runs the compiler as a child and filters its output,
  368.   rearranging as necessary.  Install with same name as compiler somewhere in
  369.   path.
  370.   
  371.   Keith Moore <moore@cs.utk.edu> wrote one such for a C compiler under AIX.
  372.   Available via FTP:                                                         !
  373.                                                                              !
  374.     /cs.utk.edu:readonly/aixcc.lex                                           !
  375.   
  376.   Jim Frost <jimf@saber.com> wrote another for the IBM xlc compiler on the
  377.   RS/6000.  (I don't know if these are both for the same compiler.)
  378.   Johnathan Vail <vail@tegra.COM> wrote something for a High C compiler
  379.   (`hc', which is one of the compilers on the RS/6000, although I think
  380.   Johnathan wrote his program for hc on a different computer).
  381.   
  382. 43:  How do I indent switch statements like this?
  383.   
  384.   Many people want to indent their switch statements like this:
  385.   
  386.     f()
  387.     {
  388.       switch(x) {
  389.         case A:
  390.           x1;
  391.           break;
  392.         case B:
  393.           x2;
  394.           break;
  395.         default:
  396.           x3;
  397.       }
  398.     }
  399.   
  400.   I don't believe there is any way to do this exactly without modifying the
  401.   Lisp code in c-mode.el.  You can set c-indent-level to 4 and
  402.   c-label-offset to -2, but this has bad effects elsewhere.  {Anyone have a
  403.   solution?}
  404.   
  405. 44:  How can I make Emacs automatically scroll horizontally?
  406.   
  407.   There is no completely correct way of doing this that does not involve     !
  408.   rewriting all commands or writing your own top-level command loop (not a   !
  409.   completely bad idea).  Wayne Mesard <wmesard@pescadero.stanford.edu> has   !
  410.   written a particularly advanced kludge called `hscroll.el' that checks     !
  411.   once a second to make sure point is visible.                               !
  412.   
  413. 45:  How do I make Emacs "typeover" or "overwrite" instead of inserting?
  414.   
  415.   M-x overwrite-mode (a minor mode).
  416.   
  417. 46:  How do I stop Emacs from beeping on a terminal?
  418.   
  419.   Martin R. Frank <martin@cc.gatech.edu> writes:
  420.   
  421.     Tell Emacs to use the 'visible bell' instead of the audible bell, and
  422.     set the visible bell to nothing.
  423.   
  424.     Put this in your TERMCAP environment variable:
  425.   
  426.       ... :vb=: ...                       
  427.   
  428.     And evaluate this:
  429.   
  430.       (setq visible-bell t)
  431.   
  432. 47:  How do I turn down the bell volume in Emacs running under X Windows?
  433.   
  434.   Under versions of Emacs before 18.58, the bell volume was annoying loud
  435.   and difficult to turn off.  So upgrading to 18.58 will reduce the volume.
  436.   If you want to turn it off completely, use `xset'.  There is no way to
  437.   turn the bell off just for Emacs without affecting all other programs.
  438.   
  439.   Under Epoch you can do:
  440.   
  441.     (setq epoch::bell-volume 20)
  442.   
  443.   Stu Grossman <grossman@sunburn.stanford.edu> wrote a patch that allows the
  444.   bell volume to be adjusted from inside Emacs just for Emacs.
  445.   
  446. 48:  How do I tell Emacs to automatically indent a new line to the
  447.  indentation of the previous line?
  448.   
  449.   One solution is Indented Text Mode (M-x indented-text-mode).
  450.   
  451.   If you have Auto-Fill mode on (a minor mode, see question 32), you can
  452.   tell Emacs to prefix every line with a certain character sequence, the
  453.   "fill prefix".  Type the prefix at the beginning of a line, position point
  454.   after it, and then type "C-x ." (set-fill-prefix) to set the fill prefix.
  455.   Thereafter, auto-filling will automatically put the fill prefix at the
  456.   beginning of new lines, and M-q (fill-paragraph) will maintain any fill
  457.   prefix when refilling the paragraph.
  458.   
  459.   NOTE: If you have paragraphs with different levels of indentation, you
  460.   will have to set the fill prefix to the correct value each time you move
  461.   to a new paragraph.  To avoid this hassle, try one of the many packages
  462.   available from the Emacs Lisp Archive.  Look up `fill' and `indent' in the
  463.   Lisp Code Directory for guidance.
  464.   
  465. 49:  How do I show which parenthesis matches the one I'm looking at?
  466.   
  467.   If you're looking at a right parenthesis (or brace or bracket) you can
  468.   delete it and reinsert it.  Emacs will blink the cursor on the matching
  469.   parenthesis.
  470.   
  471.   M-C-f (forward-sexp) and M-C-b (backward-sexp) will skip over balanced
  472.   parentheses, so you can see which parentheses match.  (You can train it to
  473.   skip over balanced brackets and braces at the same time by modifying the
  474.   syntax table.)
  475.   
  476.   Here is some Emacs Lisp that will make the % key show the matching
  477.   parenthesis, like in vi.  In addition, if the cursor isn't over a
  478.   parenthesis, it simply inserts a % like normal.
  479.   
  480.     ;; By an unknown contributor
  481.   
  482.     (global-set-key "%" 'match-paren)
  483.   
  484.     (defun match-paren (arg)
  485.       "Go to the matching parenthesis if on parenthesis otherwise insert %."
  486.       (interactive "p")
  487.       (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
  488.         ((looking-at "\\s\)") (forward-char 1) (backward-list 1))
  489.         (t (self-insert-command (or arg 1)))))
  490.   
  491. 50:  In C mode, can I show just the lines that will be left after #ifdef
  492.  commands are handled by the compiler?
  493.   
  494.   M-x hide-ifdef-mode.  (This is a minor mode.)
  495.   
  496.   You may have to (load "hideif") first.  If you want to do this regularly,
  497.   put this in your .emacs file:
  498.   
  499.     (autoload 'hide-ifdef-mode "hideif" nil t)
  500.   
  501.   {Yes, I know, this should be in lisp/loaddefs.el already.}
  502.   
  503. 51:  Is there an equivalent to the `.' (dot) command of vi?
  504.   
  505.   (`.' is the redo command in vi.  It redoes the last insertion/deletion.)
  506.   
  507.   No, not really.
  508.   
  509.   You can type "C-x ESC" (repeat-complex-command) to reinvoke commands that
  510.   used the minibuffer to get arguments.  In repeat-complex-command you can
  511.   type M-p and M-n to scan through all the different complex commands you've
  512.   typed.
  513.   
  514.   To repeat something on each line I recommend using keyboard macros.
  515.   
  516. 52:  What are the valid X resource settings (ie., stuff in .Xdefaults)?
  517.   
  518.   See the Emacs man page, or the etc/OPTIONS file.  Ignore the information
  519.   in etc/XDOC which is way out of date.
  520.   
  521. 53:  How do I execute a piece of Emacs Lisp code?
  522.   
  523.   There are a number of ways to execute (called "evaluate") an Emacs Lisp
  524.   "form":
  525.   
  526.   * If you want it evaluated every time you run Emacs, put it in a file
  527.     named `.emacs' in your home directory.
  528.   
  529.   * You can type the form in the *scratch* buffer, and then type LFD (or
  530.     C-j) after it.  The result of evaluating the form will be inserted in
  531.     the buffer.
  532.   
  533.   * In Emacs-Lisp mode, typing M-C-x evaluates a top-level form before or
  534.     around point.
  535.   
  536.   * Typing "C-x C-e" in any buffer evaluates the Lisp form immediately
  537.     before point and prints its value in the echo area.
  538.   
  539.   * Typing M-ESC or M-x eval-expression allows you to type a Lisp form in
  540.     the minibuffer which will be evaluated.
  541.   
  542.   * You can use M-x load-file to have Emacs evaluate all the Lisp forms in
  543.     a file.  (To do this from Lisp use the function `load' instead.)
  544.   
  545.   These functions are also used for evaluating Lisp forms:
  546.   
  547.     load-library, eval-region, eval-current-buffer, require, autoload
  548.   
  549. 54:  How do I change Emacs's idea of the tab character's length?
  550.   
  551.   Example: (setq default-tab-width 10).
  552.   
  553. 55:  How do I insert `>' at the beginning of every line?
  554.   
  555.   Type "M-x replace-regexp RET ^ RET > RET".
  556.   
  557.   To do this only in the region, type "C-x n M-x replace-regexp RET ^ RET
  558.   > RET C-x w".
  559.   
  560.   WARNING: The command narrow-to-region (C-x n) is disabled by default
  561.   because it can be very confusing (ie., "Oh no!  Where did my file go?").
  562.   
  563. 56:  How do I insert `_^H' before each character in a paragraph to get an
  564.  underlined paragraph?
  565.   
  566.   M-x underline-region.
  567.   
  568. 57:  How do I repeat a command as many times as possible?
  569.   
  570.   Use "C-x (" and "C-x )" to make a keyboard macro that invokes the command
  571.   and then type "M-0 C-x e".
  572.   
  573.   WARNING: any messages your command prints in the echo area will be
  574.   suppressed.
  575.   
  576. 58:  How do I make Emacs behave like this: when I go up or down, the cursor
  577.  should stay in the same column even if the line is too short?
  578.   
  579.   M-x picture-mode.  (This is a minor mode, in theory anyway ...)
  580.   
  581. 59:  How do I tell Emacs to iconify itself?
  582.   
  583.   You need to modify C source and recompile.  Either that or get Epoch or
  584.   Lucid Emacs instead.  Patches have been written by Robert Forsman
  585.   <thoth@reef.cis.ufl.edu> and Johan Vromans <jv@mh.nl> to allow Emacs to
  586.   iconify itself and by Matt Wette <mwette@mr-ed.jpl.nasa.gov> and
  587.   Manavendra K. Thakur <thakur@zerkalo.harvard.edu> (for 18.57, plus icon
  588.   geometry) to allow Emacs to start up iconified.  I don't know which of
  589.   these patches work together.
  590.   
  591.   Anonymous FTP:
  592.     /csi.jpl.nasa.gov:pub/emacs.patch1  (Matt Wette)                         +
  593.     /ftp.eu.net:gnu/emacs/FP-Xfun.Z  (Johan Vromans)                         +
  594.     /ftp.urc.tue.nl:pub/tex/emacs/FP-Xfun  (Johan Vromans)                   +
  595.   
  596. 60:  How do I use regexps (regular expressions) in Emacs?
  597.   
  598.   See `Regexps' in the online manual.
  599.   
  600.   WARNING: The "or" operator is `\|', not `|', and the grouping operators
  601.   are `\(' and `\)'.  Also, the string syntax for a backslash is "\\".
  602.   Thus, the string syntax for a regular expression like xxx\(foo\|bar\) is
  603.   "xxx\\(foo\\|bar\\)".  Notice the duplicated backslashes!
  604.   
  605.   WARNING: Unlike in Unix grep, sed, etc., a complement character set
  606.   ([^...])  can match a newline character (LFD aka C-j aka \n), unless
  607.   newline is mentioned as one of the characters not to match.
  608.   
  609.   WARNING: The character syntax regexps (eg. `\sw') are not meaningful
  610.   inside character set regexps (eg. `[aeiou]').  (This is actually typical
  611.   for regexp syntax.)
  612.   
  613. 61:  How do I perform a replace operation across more than one file?
  614.   
  615.   The "tags" feature of Emacs includes the command tags-query-replace which
  616.   performs a query-replace across all the files mentioned in the TAGS file.
  617.   See `Tags:Tags Search' in the online manual.
  618.   
  619.   In addition, Martin Boyer has written a package named global-replace which
  620.   will perform a query-replace across all the files mentioned in the
  621.   *compilation* buffer (usually done after a `grep'), which is available via
  622.   anonymous FTP:                                                             !
  623.                                                                              !
  624.     /ireq-robot.hydro.qc.ca:pub/emacs/lisp/compile.el.Z                      !
  625.     /ireq-robot.hydro.qc.ca:pub/emacs/lisp/global-replace.el.Z               !
  626.     /ireq-robot.hydro.qc.ca:pub/emacs/lisp/query.el.Z                        !
  627.   
  628. 62:  Where is the documentation for `etags'?
  629.   
  630.   `etags' takes options just like a prior version of ctags, so your ctags
  631.   manual (if any) may be useful.  {Can someone send me the details on this?}
  632.   
  633.  
  634.  
  635. Bugs/Problems
  636.  
  637. 63:  Does Emacs have problems with files larger than 8 megabytes?
  638.   
  639.   Most installed versions of GNU Emacs will use 24-bit signed integers (and
  640.   24-bit pointers) internally.  This limits the file size that Emacs can
  641.   handle to 8,388,607 bytes (2^23 - 1).
  642.   
  643.   Leonard N. Zubkoff <lnz@lucid.com> suggests putting the following two
  644.   lines in src/config.h before compiling Emacs to allow for 26-bit integers
  645.   and pointers (and thus filesizes of up to 33,554,431 bytes):
  646.   
  647.     #define VALBITS 26
  648.     #define GCTYPEBITS 5
  649.   
  650.   WARNING: This method may result in `ILLEGAL DATATYPE' and other random
  651.   errors on some machines.
  652.   
  653.   David Gillespie <daveg@csvax.cs.caltech.edu> gives an explanation of why
  654.   Emacs uses 24 bit integers and pointers:
  655.   
  656.     Emacs is largely written in a dialect of Lisp; Lisp is a freely-typed
  657.     language in the sense that you can put any value of any type into any
  658.     variable, or return it from a function, and so on.  So each value must
  659.     carry a "tag" along with it identifying what kind of thing it is, eg.,
  660.     integer, pointer to a list, pointer to an editing buffer, and so on.
  661.     Emacs uses standard 32-bit integers for data objects, taking the top 8
  662.     bits for the tag and the bottom 24 bits for the value.  So integers (and
  663.     pointers) are somewhat restricted compared to true C integers and
  664.     pointers.
  665.   
  666.     Emacs uses 8-bit tags because that's a little faster on byte-oriented
  667.     machines, but there are only really enough tags to require 6 bits.
  668.   
  669. 64:  Why can't Emacs find files in current directory on startup?
  670.   
  671.   Most likely, you have an environment variable named PWD that is set to a
  672.   value other than the name of your current directory.  This is most
  673.   likely caused by using two different shell programs.  `ksh' and (some
  674.   versions of) `csh' set and maintain the value of the PWD environment
  675.   variable, but `sh' doesn't.  If you start sh from ksh, change your
  676.   current directory inside sh, and then start Emacs from inside sh, PWD
  677.   will have the wrong value but Emacs will use this value.  See the
  678.   etc/OPTIONS file for more details.
  679.   
  680.   Perhaps an easier solution is not to use two shells.  The `chsh' program
  681.   can often be used to change one's default login shell.
  682.   
  683.   You may have PWD set for other reasons.  Another possibility is that you
  684.   are setting default-directory from your .emacs file.
  685.   
  686.   Here is a fix by Jim Blandy <jimb@occs.cs.oberlin.edu>:
  687.   
  688.     >--- emacs/jjj/emacs-18.58/lisp/startup.el    Tue Jan 15 23:19:04 1991
  689.     >+++ startup.el    Mon Apr 20 00:21:01 1992
  690.     >@@ -81,5 +81,7 @@
  691.     >     ;; In presence of symlinks, switch to cleaner form of default directory.
  692.     >     (if (and (not (eq system-type 'vax-vms))
  693.     >-         (getenv "PWD"))
  694.     >+         (getenv "PWD")
  695.     >+          (equal (nthcdr 10 (file-attributes default-directory))
  696.     >+             (nthcdr 10 (file-attributes (getenv "PWD")))))
  697.     >     (setq default-directory (file-name-as-directory (getenv "PWD"))))
  698.     >     (unwind-protect
  699.   
  700. 65:  How do I get rid of the ^M junk in my Shell buffer?
  701.   
  702.   For tcsh, put this in your `.cshrc' (or `.tcshrc') file:
  703.   
  704.     if ($?EMACS) then
  705.         if ("$EMACS" == t) then
  706.         if ($?tcsh) unset edit
  707.         stty nl
  708.     endif
  709.     endif
  710.   
  711.   Or put this in your .emacs_tcsh file:
  712.   
  713.     unset edit
  714.     stty nl
  715.   
  716.   Alternatively, use csh in your Shell buffers instead of tcsh.  One way
  717.   is:
  718.   
  719.     (setq explicit-shell-file-name "/bin/csh") 
  720.   
  721.   and another is to do this in your .cshrc (or .tcshrc) file:
  722.   
  723.     setenv ESHELL /bin/csh
  724.   
  725.   (You must start Emacs over again with the environment variable properly
  726.   set for this to take effect.)
  727.   
  728. 66:  Why do I get `Process shell exited abnormally with code 1'?
  729.   
  730.   The most likely reason for this message is that the `env' program is not
  731.   properly installed.  This program should be compiled (for the correct
  732.   architecture!) and installed with execute permission for everyone in
  733.   Emacs's program directory, which is normally /usr/local/emacs/etc.  You
  734.   can find what this directory is at your site by inspecting the value of
  735.   the variable exec-directory by typing "C-h v exec-directory RET".  `env'
  736.   should also be for the correct architecture (check using `file' command).
  737.   
  738.   You should also check for other programs named `env' in your path (eg.,
  739.   SunOS has a program named /usr/bin/env).  I don't understand why this can
  740.   cause a failure and I don't know a general solution for working around the
  741.   problem in this case.
  742.   
  743.   The `make clean' command will remove `env' and other vital programs, so be
  744.   careful when using it.
  745.   
  746.   It has been reported that this sometimes happened when Emacs was started
  747.   as an X client from an xterm window (ie. had a controlling tty) but the
  748.   xterm was later terminated.
  749.   
  750.   See also etc/PROBLEMS for other possible causes of this message.
  751.   
  752. 67:  Why can't I cut from Emacs and paste in other X programs?
  753.   
  754.   Emacs stores things you "cut" in the X "cut buffers".  It also pastes from
  755.   the cut buffer `CUT_BUFFER0'.  This is obsolete.  Most modern X programs
  756.   now expect to work with "selections" instead of cut buffers, although some
  757.   like `xterm' will try to use the cut buffers if the selection is null.
  758.   
  759.   Emacs 18.58 contains a "fix" that makes xterm work by default.  This
  760.   "fix" is that Emacs clears the `PRIMARY' selection when it stores
  761.   something in the cut buffer.  By making the selection null, xterm will
  762.   then fetch from the cut buffer when you try to paste.
  763.   
  764.   For versions of Emacs prior to 18.58, you can make pasting from Emacs into
  765.   xterm work with the following X resources:
  766.   
  767.     ! Solution by Thomas Narten, should work under X11R3 and later GNU
  768.     ! Emacs only copies to CUT_BUFFER0.  xterm by default wants to paste
  769.     ! from the PRIMARY selection.
  770.     XTerm*VT100.Translations: #override \
  771.         ~Meta <Btn2Up>: insert-selection(CUT_BUFFER0,PRIMARY)
  772.   
  773.   You may have problems copying between Emacs and programs other than xterm
  774.   that won't store cut text in the cut buffers or look in the cut buffers
  775.   for text to paste (for backwards compatibility with obsolete applications
  776.   like Emacs :-).  The best workaround is to use the `xcutsel' program as an
  777.   intermediary.                                                              -
  778.   
  779.   This problem does not exist for Epoch or Lucid Emacs.
  780.   
  781. 68:  Where is the termcap/terminfo entry for terminal type `emacs'?
  782.   
  783.   The termcap entry for terminal type `emacs' is ordinarily put in the
  784.   TERMCAP environment variable of subshells.  It may help in certain
  785.   situations (eg., using rlogin from shell buffer) to add an entry for
  786.   `emacs' to the system-wide termcap file.  Here is a correct termcap entry
  787.   for `emacs':
  788.   
  789.     emacs:tc=unknown:
  790.   
  791.   To make a terminfo entry for `emacs', use `tic' or `captoinfo'.  You need
  792.   to generate /usr/lib/terminfo/e/emacs.  It may work to simply copy
  793.   /usr/lib/terminfo/d/dumb to /usr/lib/terminfo/e/emacs.
  794.   
  795.   Having a termcap/terminfo entry will not enable the use of full screen
  796.   programs in shell buffers.  Use M-x terminal-emulator for that instead.
  797.   
  798.   A workaround to the problem of missing termcap/terminfo entries is to
  799.   change terminal type `emacs' to type `dumb' or `unknown' in your shell
  800.   start up file.  `csh' users could put this in their .cshrc files:
  801.   
  802.     if ("$term" == emacs) set term=dumb
  803.   
  804. 69:  Why does Emacs spontaneously start displaying `I-search:' and beeping?
  805.   
  806.   Your terminal (or something between your terminal and the computer) is
  807.   sending C-s and C-q for flow control, and Emacs is receiving these
  808.   characters and interpreting them as commands.  (The C-s character normally
  809.   invokes the isearch-forward command.)  For possible solutions, see
  810.   question 131.
  811.   
  812. 70:  Why can't Emacs talk to certain hosts (or certain hostnames)?
  813.   
  814.   The problem may be that Emacs is linked with a wimpier version of
  815.   gethostbyname than the rest of the programs on the machine.  This is often
  816.   manifested as a message on startup of `X server not responding.  Check
  817.   your DISPLAY environment variable.' or a message of `Unknown host' from
  818.   open-network-stream.
  819.   
  820.   On a Sun, this may be because Emacs had to be linked with the static C
  821.   library.  The version of gethostbyname in the static C library may only
  822.   look in /etc/hosts and the NIS (YP) maps, while the version in the dynamic
  823.   C library may be smart enough to check DNS in addition to or instead of
  824.   NIS.  On a Motorola Delta running System V R3.6, the version of
  825.   gethosbyname in the standard library works, but the one that works with
  826.   NIS doesn't (the one you get with -linet).  Other operating systems have
  827.   similar problems.
  828.   
  829.   Try these options:
  830.   
  831.   * Explicitly add the host you want to communicate with to /etc/hosts.
  832.   
  833.   * Relink Emacs with this line in src/config.h:
  834.   
  835.       #define LIBS_SYSTEM -lresolv
  836.   
  837.   * Replace gethostbyname and friends in libc.a with more useful versions
  838.     such as the ones in libresolv.a.  Then relink Emacs.
  839.   
  840.   * If you are actually running NIS, make sure that `ypbind' is properly
  841.     told to do DNS lookups with the correct command line switch.
  842.   
  843.   * Use tcp.el and tcp.c from GNUS.  This has the additional advantage that
  844.     you can use numeric IP addresses instead of names.  open-network-stream
  845.     currently can't handle numeric addresses.  Brian Thomson
  846.     <thomson@hub.toronto.edu> has a enhancement to open-network-stream to
  847.     allow it to handle numeric addresses.
  848.   
  849. 71:  Why does Emacs say `Error in init file'?
  850.   
  851.   An error occurred while loading either your .emacs file or the system-wide
  852.   lisp/default.el file.  For information on how to debug your .emacs file,
  853.   see question 29.
  854.   
  855.   It may be the case that you may need to load some package first, or use a
  856.   hook that will be evaluated after the package is loaded.  A common case of
  857.   this is explained in question 127.
  858.   
  859. 72:  Why does Emacs ignore my X resources (my .Xdefaults file)?
  860.   
  861.   * Try compiling Emacs with the XBACKWARDS macro defined.  There is a bug
  862.     in some implementations of XGetDefault, which do not correspond to the
  863.     documentation or the header files.
  864.   
  865.   * Make sure you are either using the class name of `Emacs' (oops,
  866.     apparently this is buggy in Emacs 18.58!) or the correct instance name.
  867.     The instance name is normally the same as the name of the file Emacs is
  868.     in (ie., the last part of argv[0]), but this can be overridden by -rn
  869.     command line option or the WM_RES_NAME environment variable.
  870.   
  871.     WARNING: Reports say using the class name fails in Emacs 18.58.
  872.   
  873.     WARNING: The advice the man page gives to use `emacs' is often wrong.
  874.   
  875.     WARNING: Older versions of Emacs got the class name wrong.
  876.   
  877.   * Emacs currently ignores the -xrm command line argument.
  878.   
  879.   * Emacs does not yet handle X11R5 screen-specific resources.
  880.   
  881.   * Emacs has a bug where it ignores color specifications if running on a
  882.     1-bit display (ie. a non-color display).
  883.   
  884.   * I don't think Emacs will use either of the application-specific resource
  885.     files.  Thus these environment variables don't affect it: XAPPLRESDIR,
  886.     XUSERFILESEARCHPATH, XFILESEARCHPATH.  {Correct?}
  887.   
  888. 73:  Why does Emacs take 20 seconds to visit a file?
  889.   
  890.   The usual cause is that the master lock file, `!!!SuperLock!!!' has been
  891.   left in the lock directory somehow.  Delete it.
  892.   
  893.   Mark Meuer <meuer@geom.umn.edu> says that NeXT NFS has a bug where an
  894.   exclusive create succeeds but returns an error status.  This can cause the
  895.   same problem.  Since Emacs's file locking doesn't work over NFS anyway,
  896.   the best solution is to recompile Emacs with CLASH_DETECTION undefined.
  897.   
  898. 74:  How do I edit a file with a `$' in its name?
  899.   
  900.   When entering a filename in the minibuffer, Emacs will attempt to expand
  901.   a `$' followed by a word as an environment variable.  To suppress this
  902.   behavior, type "$$" instead.
  903.   
  904. 75:  Why does Shell mode lose track of the shell's current directory?
  905.   
  906.   Emacs has no way of knowing when the shell actually changes its directory.
  907.   This is an intrinsic limitation of Unix.  So it tries to guess by
  908.   recognizing `cd' commands.  If you type `cd' followed by a directory name
  909.   with a variable reference (`cd $HOME/bin') or with a shell metacharacter
  910.   (`cd ../lib*'), Emacs will fail to correctly guess the shell's new current
  911.   directory.  A huge variety of fixes and enhancements to Shell mode for
  912.   this problem have been written to handle this problem.  Check the Lisp
  913.   Code Directory (see question 88).
  914.   
  915. 76:  Why doesn't my change to load-path work?
  916.   
  917.   If you added a directory name containing a tilde (~) to your load-path,
  918.   expecting the tilde to be interpreted as your home directory, then you
  919.   need to do something like this:
  920.   
  921.     (setq load-path (mapcar 'expand-file-name load-path))
  922.   
  923. 77:  Why does the cursor always go to the wrong column when I move up or
  924.  down one line?
  925.   
  926.   You have inadvertently typed "C-x C-n" (set-goal-column) which sets the
  927.   "goal column" to the column where the cursor was.  To undo this type
  928.   "C-u C-x C-n".
  929.   
  930.   If you make this mistake frequently, you might want to unbind or disable
  931.   this command by doing one of these two:
  932.   
  933.     (define-key ctl-x-map "\C-n" nil)
  934.     (put 'set-goal-column 'disabled t)
  935.   
  936. 78:  Why does Emacs hang with message `Unknown XMenu error' with X11R4?
  937.   
  938.   Many different X errors can produce this message.  Here is the solution
  939.   to one problem:
  940.   
  941.   X11 Release 4 (and later, including OpenWindows) enforces some conditions
  942.   in the X protocol that were previously allowed to pass unnoticed.  You
  943.   need to put the X11R4 server into X11R3 bug compatibility mode for Emacs's
  944.   Xmenu code to work.  You can do this with the command `xset bc'.
  945.   
  946. 79:  Why doesn't display-time show the load average in the mode line
  947.  anymore?
  948.   
  949.   In GNU Emacs 18.56, a change was made in the display-time code.
  950.   Formerly, in version 18.55, Emacs used a program named `loadst' to
  951.   notify Emacs of the change in time every minute.  loadst also sent Emacs
  952.   the system load average if it was installed with sufficient privilege to
  953.   get that information (or was on a system where no such privilege was
  954.   needed).  Emacs then displayed this information in the mode line.
  955.   
  956.   In version 18.56, this code was changed to use a program named `wakeup'.
  957.   wakeup doesn't send Emacs any information, it's only purpose is to send
  958.   Emacs *something* every minute, thus invoking the filter function in
  959.   Emacs once a minute.  The filter function in Emacs does all the work of
  960.   finding the time, date, and load average.  However, getting the load
  961.   average requires the privilege to read kernel memory on most systems.
  962.   Since giving Emacs this privilege would destroy any security a system
  963.   might have, for almost everyone this is not an option.  In addition,
  964.   Emacs does not have the code built into it to get this information on
  965.   the systems which have special system calls for this purpose, even
  966.   though loadst had code for this.
  967.   
  968.   The solution I use is to get the files lisp/display-time.el and
  969.   etc/loadst.c from version 18.55 and use those with 18.58.  (I have heard
  970.   a rumor that loadst disappeared because of the legal action Unipress
  971.   threatened against IBM.)
  972.   
  973.   WARNING:  Do not install Emacs setgid kmem unless you wish to destroy
  974.   any security your system might have!!!!!!!!!!
  975.   
  976.   If you are using Emacs 18.55 or earlier, or already using the solution I
  977.   describe above, read further:
  978.   
  979.   The most likely cause of the problem is that `loadst' can't read the
  980.   special file /dev/kmem.  To properly install loadst, it should be either
  981.   setuid to the owner of /dev/kmem, or is should be setgid to the group to
  982.   which /dev/kmem belongs.  In either case, /dev/kmem should be readable by
  983.   its owner or its group, respectively.  Assuming the existence of a group
  984.   named `kmem', here is an example of how to do this:
  985.   
  986.     chgrp kmem /dev/kmem
  987.     chmod g+r /dev/kmem
  988.     chgrp kmem /usr/local/emacs/etc/loadst
  989.     chmod g+s /usr/local/emacs/etc/loadst
  990.   
  991.   Another possibility is that your version of Unix doesn't have the load
  992.   average data available in /dev/kmem.  Your version of Unix might have a
  993.   special system call to retrieve this information (eg., inq_stats under
  994.   UMAX), and loadst might not have been enhanced to cope with this.
  995.   
  996. 80:  Why does ispell sometimes ignore the local dictionary?
  997.   
  998.   You need to update the version of Ispell to 2.0.02.  (Or you can switch to
  999.   version 3.0 which is still in beta-testing.)  A patch is available via
  1000.   anonymous FTP:                                                             !
  1001.                                                                              !
  1002.     /archive.cis.ohio-state.edu:pub/gnu/ispell/patch2.Z                      !
  1003.   
  1004.   You also need to change a line in ispell.el from:
  1005.   
  1006.     (defconst ispell-version "2.0.01") ; Check against output of "ispell -v".
  1007.   
  1008.   to:
  1009.   
  1010.     (defconst ispell-version "2.0.02") ; Check against output of "ispell -v".
  1011.   
  1012. 81:  Why does Ispell treat each line as a single word?
  1013.   
  1014.   Ispell expects to get its input one word per line.  The ispell filter,
  1015.   which is specified by the variables ispell-filter-hook and
  1016.   ispell-filter-hook-args, should output at most one word per line.
  1017.   
  1018. 82:  Are there any security risks in GNU Emacs?
  1019.   
  1020.   * the `movemail' incident (No, this is not a risk.)
  1021.   
  1022.     Cliff Stoll in his book `The Cuckoo's Egg' describes this in chapter 4.
  1023.     The site at LBL had installed the `etc/movemail' program setuid root.
  1024.     Since `movemail' had not been designed for this situation, a security
  1025.     hole was created and users could get root priveleges.
  1026.   
  1027.     `movemail' has since been changed so that even if it is installed setuid
  1028.     root this security hole will not be a result.
  1029.   
  1030.     I have heard unverified reports that the Internet worm took advantage of
  1031.     this configuration problem.
  1032.   
  1033.   * the file-local-variable feature (Yes, a risk, but easy to change.)
  1034.   
  1035.     There is an Emacs feature that allows the setting of local values for
  1036.     variables when editing a file by including specially formatted text near
  1037.     the end of the file.  This feature also includes the ability to have
  1038.     arbitrary Emacs Lisp code evaluated when the file is visited.
  1039.     Obviously, there is a potential for Trojan horses to exploit this
  1040.     feature.
  1041.   
  1042.     If you set the variable inhibit-local-variables to a non-nil value,
  1043.     Emacs will display the special local variable settings of a file that
  1044.     you visit and ask you if you really want them.  This variable is not
  1045.     mentioned in the manual.
  1046.   
  1047.     It is wise to do this in lisp/site-init.el before building Emacs:
  1048.   
  1049.       (setq inhibit-local-variables t)
  1050.   
  1051.     If Emacs has already been built, the expression can be put in
  1052.     lisp/default.el instead, or an individual can put it in their own .emacs
  1053.     file.
  1054.   
  1055.     The ability to exploit this feature by sending e-mail to an RMAIL user
  1056.     was fixed sometime after Emacs 18.52.  However, any new package that
  1057.     uses find-file or find-file-noselect has to be careful about this.
  1058.   
  1059.     For more information, see `File Variables' in the online manual (which,
  1060.     incidentally, does not describe how to disable the feature).
  1061.   
  1062.     There is a new variable in Emacs 18.58 named ignore-local-eval which
  1063.     turns out to be useless as currently implemented.  Ignore it.
  1064.   
  1065.   * synthetic X events (Yes, a risk, use MIT-MAGIC-COOKIE-1 or better.)
  1066.   
  1067.     Emacs accepts synthetic X events generated by the SendEvent request as
  1068.     though they were regular events.  As a result, if you are using the
  1069.     trivial host-based authentication, other users who can open X
  1070.     connections to your X workstatation can make your Emacs process do
  1071.     anything, including run other processes with your priveleges.
  1072.   
  1073.     The only fix for this is to prevent other users from being able to open
  1074.     X connections.  The standard way to prevent this is to use a real
  1075.     authentication mechanism, such as MIT-MAGIC-COOKIE-1.  If using the
  1076.     `xauth' program has any effect, then you are probably using
  1077.     MIT-MAGIC-COOKIE-1.  Your site may be using a superior authentication
  1078.     method; ask your system administrator.
  1079.   
  1080.     If real authentication is not a possibility, you may be satisfied by
  1081.     just allowing hosts access for brief intervals while you start your X
  1082.     programs, then removing the access.  This reduces the risk somewhat by
  1083.     narrowing the time window when hostile users would have access, but DOES
  1084.     NOT ELIMINATE THE RISK.
  1085.   
  1086.     Lucid GNU Emacs does not accept synthetic X events unless you set a      +
  1087.     variable.                                                                +
  1088.   
  1089.   * autosave file permissions (Yes, a risk, hard to work around.)
  1090.   
  1091.     The file permissions for autosave files are determined solely by the
  1092.     Emacs process's `umask' value.  The permissions of the file being
  1093.     autosaved are not used.  The easiest workaround is to keep sensitive
  1094.     files in protected directories.  Sebastian Kremer has written an
  1095.     enhanced version of the autosave file name picking code that can avoid
  1096.     this problem by keeping autosave files in a protected directory.  {FTP
  1097.     information please?}  This problem will be fixed in Emacs 19.
  1098.   
  1099.  
  1100.  
  1101. Difficulties Building/Installing/Porting Emacs
  1102.  
  1103. 83:  What should I do if I have trouble building Emacs?
  1104.   
  1105.   First look in the file etc/PROBLEMS to see if there is already a solution
  1106.   for your problem.  Next check the FAQ (you're reading it).  If you don't
  1107.   find a solution, then report your problem via e-mail to
  1108.   bug-gnu-emacs@prep.ai.mit.edu.  Please do not post it to gnu.emacs.help or
  1109.   e-mail it to help-gnu-emacs@prep.ai.mit.edu.  For further guidelines, see
  1110.   question 8.
  1111.   
  1112. 84:  How do I stop Emacs from failing when the executable is stripped?
  1113.   
  1114.   Don't do that.
  1115.   
  1116.   This problem has been reported on SGI Indigo machines running Irix 4.0.*
  1117.   and RS/6000 machines.  Scott Henry <scotth@hoshi.corp.SGi.COM> posted a
  1118.   patch that fixes the problem for Irix.
  1119.   
  1120. 85:  Why does linking Emacs with -lX11 fail?                                 !
  1121.                                                                              !
  1122.   Emacs needs to be linked with the static version of the X11 library,       !
  1123.   libX11.a.  This may be missing.                                            !
  1124.                                                                              !
  1125.   Under OpenWindows, you may need to use `add_services' to add the           !
  1126.   `OpenWindows Programmers' optional software category from the CD-ROM.      -
  1127.   
  1128.   Under HP-UX 8.0, you may need to run `update' again to load the            -
  1129.   X11-PRG `fileset'.  This may be missing even if you specified `all
  1130.   filesets' the first time.  If libcurses.a is missing, you may need to load
  1131.   the `Berkeley Development Option' {???}.
  1132.   
  1133.   If you are building the MIT X11 sources, you may need to modify your       +
  1134.   `site.cf' file to get static versions of the libraries.  (Info from David  +
  1135.   Zuhn <zoo@cygnus.com>.)                                                    +
  1136.                                                                              +
  1137.   Other systems may have similar problems.  You can always define            +
  1138.   CANNOT_DUMP and link with the shared libraries instead.
  1139.   
  1140.   To get the Xmenu stuff to work, you need to find a copy of MIT's           +
  1141.   liboldX.a.                                                                 +
  1142.   
  1143. 86:  Why does Emacs 18.55 say `Fatal error (6).Abort' under SunOS 4.1?
  1144.   
  1145.   I had hoped this question would go away after Emacs 18.57 was released,
  1146.   but people continue to compile 18.55.  Easiest solution: upgrade.
  1147.   
  1148.   This is a result of the SunOS localtime/tzsetwall malloc bug, which was
  1149.   (finally!) fixed in SunOS 4.1.2.  If you actually need the full
  1150.   explanation, send me e-mail.  If you absolutely must compile Emacs 18.55
  1151.   (eg., you are compiling Nemacs), the easiest workaround was to put
  1152.   `#define SYSTEM_MALLOC' in src/config.h.                                   -
  1153.   
  1154.  
  1155.  
  1156.